Nowadays, the technology of streaming media files for playing an audio/visual material (e.g., a video, an audio media, etc.) on an electronic device has become common. In general, the media files demanded by a user are requested by the electronic device and subsequently received from a data server via a network such as the Internet. Typically, the audio/visual material may be available from the data server in a number of different qualities. A user may designate one of the qualities, or authorize a player application to dynamically determine a suitable quality during the playing of the audio/visual material. This technology may be referred to as adaptive bitrate streaming.
A number of ways may be employed for implementing adaptive bitrate streaming. For example, the HyperText Transfer Protocol (HTTP) may be used in transmitting data over a computer network. The player application may continuously detect a network bandwidth and a capacity of a central processing unit (CPU) of the electronic device. When the user operates the electronic device to control the player application to start playing the audio/visual material, the CPU transmits a request to a source of the streaming media files, requesting data packets constituting media file segments having a lowest quality. Afterward, the electronic device starts downloading the data packets that constitute the media file segments, stores the data packets in a data buffer of a memory device of the electronic device, and starts playing the media file segments sequentially (that is, using an interface to “play” the media file segments for the user).
During the playing of the media file segments, the CPU compares the network bandwidth with a bitrate of the media file segments, and determines whether a higher quality may be achieved.
It is noted that, when all of the media file segments constituted by the data packets stored in the data buffer has been played, and new data packets constituting a new media file segment have not been completely downloaded yet, the playing may be forcibly paused, entering a buffering state to wait for the new data packets to be downloaded in full. Such an event may be referred to as stalling.